/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 scenario_cut_scene_id.cpp

	$Header: /heroes4/scenario_cut_scene_id.cpp $

	$NoKeywords: $

 ************************************************************************/

#include "precompiled.h"
#include "scenario_cut_scene_id.h"

#include <assert.h>

// --------------------------------------------------------------------------
// Unnamed namespace
// --------------------------------------------------------------------------

namespace
{

	// --------------------------------------------------------------------------
	// t_properties struct
	// --------------------------------------------------------------------------

	struct t_properties
	{
		// Data members
		std::string	keyword;
		std::string	resource_name;

		// Constructor
		t_properties(
			std::string const &	keyword_arg,
			std::string const &	resource_name_arg );
	};

	// --------------------------------------------------------------------------
	// t_properties members
	// --------------------------------------------------------------------------
	
	// --------------------------------------------------------------------------
	// --------------------------------------------------------------------------
	inline t_properties::t_properties(
		std::string const &	keyword_arg,
		std::string const &	resource_name_arg )
		:	keyword( keyword_arg ),
			resource_name( resource_name_arg )
	{
	}

	// --------------------------------------------------------------------------
	// Non member functions
	// --------------------------------------------------------------------------

	// --------------------------------------------------------------------------
	// --------------------------------------------------------------------------
	std::string const & get_empty_string()
	{
		static std::string const k_empty_string;
		return k_empty_string;
	}

	// --------------------------------------------------------------------------
	// --------------------------------------------------------------------------
	t_properties const & get_properties( t_scenario_cut_scene_image_id image_id )
	{
		assert( image_id >= 0 && image_id < k_scenario_cut_scene_image_count );

		static t_properties const k_properties[ k_scenario_cut_scene_image_count ] =
		{
			t_properties( "ambush", "ambush" ),
			t_properties( "attack_castle", "attack_castle" ),
			t_properties( "chaos_intro", "chaos_intro" ),
			t_properties( "chaos_outro", "chaos_outro" ),
			t_properties( "dead_black_dragon", "dead_black_dragon" ),
			t_properties( "dead_hero", "dead_hero" ),
			t_properties( "death_intro", "death_intro" ),
			t_properties( "death_outro", "death_outro" ),
			t_properties( "defend_castle", "defend_castle" ),
			t_properties( "dwarf_vs_spellcaster", "dwarf_vs_spellcaster" ),
			t_properties( "hills", "hills" ),
			t_properties( "last_stand", "last_stand" ),
			t_properties( "life_intro", "life_intro" ),
			t_properties( "life_outro", "life_outro" ),
			t_properties( "magic_vs_magic", "magic_vs_magic" ),
			t_properties( "might_intro", "might_intro" ),
			t_properties( "might_outro", "might_outro" ),
			t_properties( "nature_intro", "nature_intro" ),
			t_properties( "nature_outro", "nature_outro" ),
			t_properties( "order_intro", "order_intro" ),
			t_properties( "order_outro", "order_outro" ),
			t_properties( "pirate_battle", "pirate_battle" ),
			t_properties( "swordfight", "swordfight" ),
			t_properties( "tunnel", "tunnel" ),
		};

		return k_properties[ image_id ];
	}

	// --------------------------------------------------------------------------
	// --------------------------------------------------------------------------
	t_properties const & get_properties(
		t_scenario_cut_scene_voice_over_id	voice_over_id )
	{
		assert( voice_over_id >= 0 && voice_over_id < k_scenario_cut_scene_voice_over_count );

		static t_properties const k_properties[ k_scenario_cut_scene_voice_over_count ] =
		{
			t_properties( "chaos_a_prologue", "Chaos A" ),
			t_properties( "chaos_b_prologue", "Chaos B" ),
			t_properties( "chaos_c_prologue", "Chaos C" ),
			t_properties( "chaos_d_prologue", "Chaos D" ),
			t_properties( "chaos_e_prologue", "Chaos E - Intro" ),
			t_properties( "chaos_epilogue", "Chaos E - Epilogue" ),
			t_properties( "death_a_prologue", "Death A" ),
			t_properties( "death_b_prologue", "Death B" ),
			t_properties( "death_c_prologue", "Death C" ),
			t_properties( "death_d_prologue", "Death D" ),
			t_properties( "death_e_prologue", "Death E - Intro" ),
			t_properties( "death_epilogue", "Death E - Epilogue" ),
			t_properties( "life_a_prologue", "Life A" ),
			t_properties( "life_b_prologue", "Life B" ),
			t_properties( "life_c_prologue", "Life C" ),
			t_properties( "life_d_prologue", "Life D" ),
			t_properties( "life_e_prologue", "Life E - Intro" ),
			t_properties( "life_epilogue", "Life E - Epilogue" ),
			t_properties( "might_a_prologue", "Might A" ),
			t_properties( "might_b_prologue", "Might B" ),
			t_properties( "might_c_prologue", "Might C" ),
			t_properties( "might_d_prologue", "Might D - Intro" ),
			t_properties( "might_epilogue", "Might D - Epilogue" ),
			t_properties( "nature_a_prologue", "Nature A" ),
			t_properties( "nature_b_prologue", "Nature B" ),
			t_properties( "nature_c_prologue", "Nature C" ),
			t_properties( "nature_d_prologue", "Nature D" ),
			t_properties( "nature_e_prologue", "Nature E - Intro" ),
			t_properties( "nature_epilogue", "Nature E - Epilogue" ),
			t_properties( "order_a_prologue", "Order A" ),
			t_properties( "order_b_prologue", "Order B" ),
			t_properties( "order_c_prologue", "Order C" ),
			t_properties( "order_d_prologue", "Order D" ),
			t_properties( "order_e_prologue", "Order E" ),
			t_properties( "order_epilogue", "Order H - Epilogue" ),
			t_properties( "order_f_prologue", "Order F" ),
			t_properties( "order_g_prologue", "Order G" ),
			t_properties( "order_h_prologue", "Order H - Intro" ),
		};

		return k_properties[ voice_over_id ];
	}

} // Unnamed namespace

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
std::string const & get_keyword(
	t_scenario_cut_scene_image_id	image_id )
{
	if ( image_id == k_scenario_cut_scene_image_none )
		return get_empty_string();

	return get_properties( image_id ).keyword;
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
std::string const & get_resource_name(
	t_scenario_cut_scene_image_id	image_id )
{
	return get_properties( image_id ).resource_name;
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
std::string const & get_keyword(
	t_scenario_cut_scene_voice_over_id	voice_over_id )
{
	if ( voice_over_id == k_scenario_cut_scene_voice_over_none )
		return get_empty_string();

	return get_properties( voice_over_id ).keyword;
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
std::string const & get_resource_name(
	t_scenario_cut_scene_voice_over_id	voice_over_id )
{
	return get_properties( voice_over_id ).resource_name;
}
